package com.neighbor.neighborhooduser.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.neighbor.neighborhooduser.pojo.ItemOrders;
import com.baomidou.mybatisplus.extension.service.IService;
import com.neighbor.neighborhooduser.pojo.OrderWithItemDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 物品交易订单表 服务类
 * </p>
 *
 * @author song
 * @since 2025-09-22 09:13:04
 */
public interface IItemOrdersService extends IService<ItemOrders> {
    Integer createOrder(ItemOrders orders);
    ItemOrders getByOrderNumber(String orderNumber);
    Integer updateStatus(Integer id);

    // 卖家订单查询
    List<OrderWithItemDTO> findOrdersBySellerAndStatus(Integer userId, Byte status);

    // 买家订单查询
    List<OrderWithItemDTO> findOrdersByBuyerAndStatus(Integer userId, Byte status);


    //根据物品标题模糊查询
    List<OrderWithItemDTO> findOrdersByUserIdAndItemTitle(Integer userId, String title);


    //两个都是获取作为卖家或者买家的订单
    List<OrderWithItemDTO> findSellerOrdersWithDetails(Integer userId);

    List<OrderWithItemDTO> findBuyerOrdersWithDetails(Integer userId);

    //根据订单id获取订单，用户，物品信息
    OrderWithItemDTO findOrderDetailsById(Integer orderId);
}
